// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import ElementUI from 'element-ui'
import axios from 'axios'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App'
import router from './router'
import animate from 'animate.css'
import VueSocketio from 'vue-socket.io'

// import socketio from 'socket.io-client'

Vue.use(animate)
Vue.use(ElementUI)

Vue.prototype.$http = axios.create({
  baseURL: process.env.API_ROOT // 自己定义一个baseURL，这里我写在了实例里面
})

Vue.use(
  new VueSocketio({
    debug: true,
    connection: process.env.API_ROOT
  })
)
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  VueSocketio,
  components: {
    App
  },
  template: '<App/>'
})
